<#assign menu="appUser">
<#assign submenu="appUser_list">
<#include "../../manage/head.ftl">
<style type="text/css">
    .pagination {
        border-radius: 4px;
        display: inline-block;
        margin: 0;
        padding-left: 0;
    }

    .howto, .nonessential, #edit-slug-box, .form-input-tip, .subsubsub {
        color: #666666;
    }

    .subsubsub {
        float: left;
        font-size: 12px;
        list-style: none outside none;
        margin: 8px 0 5px;
        padding: 0;
    }

    .form-group {
        width: 100%;
    }

    .count {
        position: absolute;
        right: 0px;
    }

    .arrticle_status {
        float: left;
    }
    th{
        text-align: center;
    }
    td{
        text-align: center;
    }
</style>
<!--main content start-->
<section id="main-content">
    <section class="wrapper">

        <!-- page start-->
        <section class="panel">
            <header class="panel-heading">
                <div class="row">
                    <div class="col-lg-4">
                        <ul class="breadcrumb" style="margin-bottom:0px;">
                            <li>
                                <a href="${BASE_PATH}/manage/appUser/list.htm" class="btn btn-primary">用户列表</a>
                            </li>
                        </ul>
                    </div>
                    <div class="col-lg-8">
                        <a class="btn btn-primary" style="float:right;"
                           href="${BASE_PATH}/manage/appUser/add.htm">添加用户</a>
                    </div>
                </div>
            </header>
            <div class="panel-body">
                <div class="adv-table">
                    <div role="grid" class="dataTables_wrapper" id="hidden-table-info_wrapper">
                        <table class="table table-striped table-advance table-hover">
                            <thead>
                            <tr>
                                <th>名字</th>
                                <th>性别</th>
                                <th>签名</th>
                                <th>是否达人</th>
                                <th>状态</th>
                                <th>操作</th>

                            </tr>
                            </thead>
                            <tbody role="alert" aria-live="polite" aria-relevant="all">
                            <#list pageVo.list as e>
                            <tr class="gradeA odd">
                                <td>
                                    <#--<a href="${BASE_PATH}/manage/goods/update.htm?goodsId=${e.id}">${e.name}</a>-->
                                    ${e.name}
                                </td>
                                <td>
                                    <#if e.gender==1> 男</#if>
                                    <#if e.gender==0> 女</#if>
                                </td>
                                <td>${e.signature!}</td>
                                <td>
                                    <#if e.isDR=0> <span class="label label-sm label-default">否</span></#if>
                                    <#if e.isDR=1><span class="label label-sm label-warning">申请中 </span></#if>
                                    <#if e.isDR=2> <span class="label label-sm label-success">是 </span></#if>
                                </td>

                                <td>
                                    <#if e.authorization==1><span class="label label-sm label-success">在用</span></#if>
                                    <#if e.authorization==0><span class="label label-sm label-default">禁用</span></#if>
                                </td>
                                <td>
                                   <#if e.authorization==1>
                                        <a href="javascript:void(0);" class="js_appUser_delete btn btn-primary" appUserId="${e.id}"
                                           title="是否禁用此账号">
                                            &nbsp禁用&nbsp
                                        </a>
                                   </#if>
                                    <#if e.authorization==0>
                                        <a href="javascript:void(0);" class="js_appUser_on btn btn-primary" appUserId="${e.id}"
                                           title="是否启用此账号">
                                            &nbsp启用&nbsp
                                        </a>
                                    </#if>

                                    <#if e.isDR=1>

                                        <a href="javascript:void(0)" class="js_appUser_DRCheck btn btn-primary" appUserId="${e.id}" title="达人审核">通过达人</a>
                                    </#if>
                                    <#if e.isDR=2>

                                        <a href="javascript:void(0)" class="js_appUser_DRCancel btn btn-primary" appUserId="${e.id}" title="取消达人">取消达人</a>
                                    </#if>
                                </td>
                            </tr>
                            </#list>
                            </tbody>
                        </table>
                        <div style="height: 30px;">
                            <div class="pagination">${pageVo.pageNumHtml} </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- page end-->
    </section>
</section>
<!--main content end-->
<script>
    $(function () {
        var pageNum = "${p}";
        $('.js_appUser_delete').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/delete.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $('.js_appUser_on').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/getOn.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $('.js_appUser_DRCheck').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/DRCheck.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {
                             alert("失败");
                        }
                    }
                }
            });
        });

        $('.js_appUser_DRCancel').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/DRCancel.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });
    });
</script>
<#include "../../manage/foot.ftl">
